;;; af
;;; Language: R5RS

(define (square a) (* a a))

(define (sum-of-squares a b) (+ (square a) (square b)))

(define (sum-of-squares-of-two-larger a b c)
  (cond ((and (> a c) (> b c)) (sum-of-squares a b))
        ((and (> a b) (> c b)) (sum-of-squares a c))
        ((and (> b a) (> c a)) (sum-of-squares b c))))

; > (sum-of-squares-of-two-larger 1 2 3)
; 13
; > (sum-of-squares-of-two-larger 2 1 3)
; 13
; > (sum-of-squares-of-two-larger 2 3 1)
; 13